#pragma once
#include "TypeDefs.h"
#include "TextureIndex.h"
#include "BlockSide.h"
#include <map>
using namespace std;
class MultiTextureIndex
{
public:
	MultiTextureIndex(void);
	MultiTextureIndex(uint textureName);
	~MultiTextureIndex(void);
	MultiTextureIndex(const TextureIndex &singleIndexObject);
	void operator=(const TextureIndex &singleIndexObject);
	void SetTexture(uint textureName);
	uint &operator[](uint subTextureID);
	uint GetTextureName() const;
	vector2 GetIndexXY(uint subTextureID, uint xDivisions) const;
	const vector2 &GetUV(uint subTextureID) const;
	void PreCalculateUVs(const vector2 &tiling);
	uint GetSideCount() const;
private:
	void _init();
	void _destroy();

private:
	uint m_nTextureName;
	uint *m_textureIndices;
	vector2 *m_preCalcUV;
};

